﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using efish.Framework.Common;

public partial class Controls_AvailabilityDisplay : System.Web.UI.UserControl
{
    private int _value = 0;
    public int Value
    {
        get { return _value; }
        set
        {
            _value = value;
            if (_value <= 0)
            {
                imgAvailability.ImageUrl = "~/images/lightred.gif";
                imgAvailability.AlternateText = "Currently not available";
            }
            else if (_value <= efishConfig.Settings.Store.LowAvailability)
            {
                imgAvailability.ImageUrl = "~/images/lightyellow.gif";
                imgAvailability.AlternateText = "Few units available";
            }
            else
            {
                imgAvailability.ImageUrl = "~/images/lightgreen.gif";
                imgAvailability.AlternateText = "Available";
            }
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {

    }
}
